package com.centling.smartSealForPhone.adapter;

import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.centling.smartSealForPhone.R;
import com.centling.smartSealForPhone.activity.AuditorPicCheckActivity;

/**
 *
 * @author Jessie
 * @date 2016/8/17
 */
public class AuditorSealPicAdapter extends RecyclerView.Adapter<AuditorSealPicAdapter.PicViewHolder> {

    private Context context;


    public AuditorSealPicAdapter(Context context) {
        this.context = context;

    }

    @Override
    public PicViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new PicViewHolder(LayoutInflater.from(context)
                .inflate(R.layout.item_auditor_seal_pic, parent, false));
    }

    @Override
    public void onBindViewHolder(AuditorSealPicAdapter.PicViewHolder holder, int position) {
        holder.auditorSealPic.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                context.startActivity(new Intent(context, AuditorPicCheckActivity.class));
            }
        });
    }

    @Override
    public int getItemCount() {
        return 20;
    }

    class PicViewHolder extends RecyclerView.ViewHolder {
        ImageView auditorSealPic;

        PicViewHolder(View itemView) {
            super(itemView);
            auditorSealPic = itemView.findViewById(R.id.iv_auditor_seal_pic);
        }
    }
}
